export default class BaseWindow extends fgui.Window {
    hideCallback: Function;
    public constructor() {
      super();
      this.setPivot(0.5, 0.5);
    }
  
    protected doShowAnimation(): void {
      this.setScale(0.1, 0.1);
      fgui.GTween.to2(0.1, 0.1, 1.15, 1.15, 0.15)
        .setTarget(this, this.setScale)
        .setEase(fgui.EaseType.QuadOut)
        .onComplete(function() {
          fgui.GTween.to2(1.15, 1.15, 1, 1, 0.1)
            .setTarget(this, this.setScale)
            .setEase(fgui.EaseType.QuadOut)
            .onComplete(() => {
              this.onShown();
            }, this);
        }, this);
      if (this.closeButton && this.closeButton.asButton) {
      }
    }
  
    protected doHideAnimation(): void {
      fgui.GTween.to2(1, 1, 0.1, 0.1, 0.2)
        .setTarget(this, this.setScale)
        .setEase(fgui.EaseType.QuadOut)
        .onComplete(this.hideImmediately, this);
      this.hideCallback && this.hideCallback();
      this.hideCallback = null;
    }
  
    stopEventDisp(events) {
      events.stopPropagation();
    }
  }
  